package top.ahzy.seobench.model.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author ahzy
 * @since 2024-4-17 14:09:29
 */
@Data
@Accessors(chain = true)
@TableName("seo_user")
@ApiModel(value = "SysUser对象", description = "系统用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId("id")
    private String id;

    @ApiModelProperty("用户昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty("用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("盐")
    @TableField("salt")
    private String salt;

    @ApiModelProperty("手机号")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("邮箱")
    @TableField("mailbox")
    private String mailbox;

    @ApiModelProperty("头像")
    @TableField("photo")
    private String photo;

    @ApiModelProperty("性别 0:未知 1:男 2:女")
    @TableField("sex")
    private Integer sex;

    @ApiModelProperty("状态 1:启用 0:禁用")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("描述")
    @TableField("describes")
    private String describes;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 	// 页面写入数据库时格式化
    @JSONField(format="yyyy-MM-dd HH:mm:ss")	    // 数据库导出页面时json格式化
    @TableField("create_time")
    private Date createTime;

}
